New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

algosdk

Package Overview
Dependencies
Maintainers
2
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

algosdk

The official JavaScript SDK for Algorand

  • 2.10.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
130K
increased by18.55%
Maintainers
2
Weekly downloads
 
Created

What is algosdk?

The algosdk npm package is a JavaScript library for interacting with the Algorand blockchain. It provides tools for building applications on Algorand, including creating and managing accounts, sending transactions, and interacting with smart contracts.

What are algosdk's main functionalities?

Account Management

This feature allows you to create and manage Algorand accounts. The code sample demonstrates how to generate a new account and retrieve its address and mnemonic.

const algosdk = require('algosdk');
const account = algosdk.generateAccount();
console.log('Address:', account.addr);
console.log('Mnemonic:', algosdk.secretKeyToMnemonic(account.sk));

Transaction Handling

This feature enables the creation and submission of transactions on the Algorand blockchain. The code sample shows how to create a payment transaction, sign it, and send it to the network.

const algosdk = require('algosdk');
const algodClient = new algosdk.Algodv2(token, server, port);
const txn = algosdk.makePaymentTxnWithSuggestedParamsFromObject({
  from: senderAddress,
  to: receiverAddress,
  amount: 1000000,
  suggestedParams: await algodClient.getTransactionParams().do()
});
const signedTxn = txn.signTxn(senderPrivateKey);
const sendTx = await algodClient.sendRawTransaction(signedTxn).do();
console.log('Transaction ID:', sendTx.txId);

Smart Contract Interaction

This feature allows interaction with Algorand smart contracts. The code sample demonstrates how to call a smart contract with arguments using a NoOp transaction.

const algosdk = require('algosdk');
const algodClient = new algosdk.Algodv2(token, server, port);
const appArgs = [algosdk.encodeUint64(123)];
const txn = algosdk.makeApplicationNoOpTxn(senderAddress, await algodClient.getTransactionParams().do(), appId, appArgs);
const signedTxn = txn.signTxn(senderPrivateKey);
const sendTx = await algodClient.sendRawTransaction(signedTxn).do();
console.log('Transaction ID:', sendTx.txId);

Other packages similar to algosdk

FAQs

Package last updated on 15 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc